<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>  
<!DOCTYPE html>
<html class="x-admin-sm">
    <head>
        <meta charset="UTF-8">
        <title>后台管理</title>
        <meta name="renderer" content="webkit|ie-comp|ie-stand">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta http-equiv="Cache-Control" content="no-siteapp" />
        <link rel="stylesheet" href="<%=basePath %>backPage/css/font.css">
        <link rel="stylesheet" href="<%=basePath %>backPage/css/xadmin.css">
        <link rel="stylesheet" href="<%=basePath %>backPage/css/theme5.css">
        <script src="<%=basePath %>backPage/lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="<%=basePath %>backPage/js/xadmin.js"></script>
        <script type="text/javascript" src="<%=basePath %>backPage/js/jquery.min.js"></script>
    </head>
    <body class="index" style="background-image:url(/market/backPage/images/pc_01.jpg);">
        <!-- 顶部开始 -->
        <div class="container">
            <div class="logo">
                <a onclick="toIndex()" href="javascript:;">
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                	后台管理
                </a>
            </div>
            <div class="left_open">
                <a><i title="展开左侧栏" class="iconfont">&#xe699;</i></a>
            </div>
            <ul class="layui-nav left fast-add" lay-filter="">
                <li class="layui-nav-item">
                    <a href="javascript:;">
                    		<span id="noReplyMessageShow">
                    		</span>
                    	<i class="iconfont" style="font-size: 20px; color: #FFFFF;">
                    		&#xe713;
                    	</i>
                    </a>
                    <dl class="layui-nav-child">
                        <dd>
                            <a id="viewMessage">
                                <i class="iconfont">&#xe69f;</i><span id="addNoReplyCount"></span>
                            </a>
                        </dd>
                    </dl>
                </li>
            </ul>
            <ul class="layui-nav right" lay-filter="">
                <li class="layui-nav-item">
                    <a id="user" href="javascript:;">
                    	<c:if test="${not empty userInfo }">
                    		${userInfo.name }
                    	</c:if>
                    	<c:if test="${empty userInfo }">
                    		未登录
                    	</c:if>
                    </a>
                    
                    <dl class="layui-nav-child">
                        <!-- 二级菜单 -->
                        <dd>
	                        <a onclick="xadmin.open('个人信息','<%=basePath %>backPage/personalCenter.jsp',800,600)">
	                        	个人信息
	                        </a>
	                    </dd>
                        <dd>
                            <a onclick="xadmin.open('切换帐号','<%=basePath %>back/toLogin')">切换帐号</a></dd>
                        <dd>
                            <a href="<%=basePath %>back/loginOut">退出</a>
                        </dd>
                    </dl>
                </li>
                <li class="layui-nav-item to-index">
                    <a href="<%=basePath %>" target="_black" >前台首页</a></li>
            </ul>
        </div>
        <!-- 顶部结束 -->
        <!-- 中部开始 -->
        <!-- 左侧菜单开始 -->
        <div class="left-nav">
            <div id="side-nav">
                <ul id="nav">
                    <li>
                        <a href="javascript:;">
                            <i class="iconfont left-nav-li" lay-tips="用户管理">&#xe726;</i>
                            <cite>用户管理</cite>
                            <i class="iconfont nav_right">&#xe697;</i></a>
                        <ul class="sub-menu">
                            <li>
                                <a onclick="xadmin.add_tab('用户页面','<%=basePath %>backPage/user-list.jsp')">
                                    <i class="iconfont">&#xe6a7;</i>
                                    <cite>用户列表</cite></a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="javascript:;">
                            <i class="iconfont left-nav-li" lay-tips="订单管理">&#xe723;</i>
                            <cite>订单管理</cite>
                            <i class="iconfont nav_right">&#xe697;</i></a>
                        <ul class="sub-menu">
                            <li>
                                <a onclick="xadmin.add_tab('订单列表','<%=basePath %>backPage/orderInfo-list.jsp')">
                                    <i class="iconfont">&#xe6a7;</i>
                                    <cite>订单列表</cite></a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="javascript:;">
                            <i class="iconfont left-nav-li" lay-tips="分类管理">&#xe699;</i>
                            <cite>分类管理</cite>
                            <i class="iconfont nav_right">&#xe697;</i></a><!-- &#xe698; &#xe723; -->
                        <ul class="sub-menu">
                            <li>
                                <a onclick="xadmin.add_tab('分类列表','<%=basePath %>backPage/productType-list.jsp')">
                                    <i class="iconfont">&#xe6a7;</i>
                                    <cite>商品分类</cite></a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="javascript:;">
                            <i class="iconfont left-nav-li" lay-tips="商品管理">&#xe83b;</i>
                            <cite>商品管理</cite>
                            <i class="iconfont nav_right">&#xe697;</i></a>
                        <ul class="sub-menu">
                            <li>
                                <a onclick="xadmin.add_tab('商品列表','<%=basePath %>backPage/product-list.jsp')">
                                    <i class="iconfont">&#xe6a7;</i>
                                    <cite>商品列表</cite></a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="javascript:;">
                            <i class="iconfont left-nav-li" lay-tips="图片管理">&#xe6a8;</i>
                            <cite>图片管理</cite>
                            <i class="iconfont nav_right">&#xe697;</i></a>
                        <ul class="sub-menu">
                            <li>
                                <a onclick="xadmin.add_tab('图片列表','<%=basePath %>backPage/images-list.jsp')">
                                    <i class="iconfont">&#xe6a7;</i>
                                    <cite>图片列表</cite></a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="javascript:;">
                            <i class="iconfont left-nav-li" lay-tips="购物车管理">&#xe698;</i>
                            <cite>购物车管理</cite>
                            <i class="iconfont nav_right">&#xe697;</i></a>
                        <ul class="sub-menu">
                            <li>
                                <a onclick="xadmin.add_tab('购物车列表','<%=basePath %>backPage/cart-list.jsp')">
                                    <i class="iconfont">&#xe6a7;</i>
                                    <cite>购物车列表</cite></a>
                            </li>
                        </ul>
                    </li>
                    <%-- <li>
                        <a href="javascript:;">
                            <i class="iconfont left-nav-li" lay-tips="地址管理">&#xe6e3;</i>
                            <cite>地址管理</cite>
                            <i class="iconfont nav_right">&#xe697;</i></a>
                        <ul class="sub-menu">
                            <li>
                                <a onclick="xadmin.add_tab('地址列表','<%=basePath %>backPage/address-list.jsp')">
                                    <i class="iconfont">&#xe6a7;</i>
                                    <cite>地址列表</cite></a>
                            </li>
                        </ul>
                    </li> --%>
                    <li>
                        <a href="javascript:;">
                            <i class="iconfont left-nav-li" lay-tips="评价管理">&#xe69e;</i>
                            <cite>留言管理</cite>
                            <i class="iconfont nav_right">&#xe697;</i></a>
                        <ul class="sub-menu">
                            <li>
                                <a onclick="xadmin.add_tab('评价列表','<%=basePath %>backPage/message-list.jsp')">
                                    <i class="iconfont">&#xe6a7;</i>
                                    <cite>留言列表</cite></a>
                            </li>
                        </ul>
                    </li>
                    <!-- 
                    <li>
                        <a href="javascript:;">
                            <i class="iconfont left-nav-li" lay-tips="商品规格管理">&#xe728;</i>
                            <cite>商品规格管理</cite>
                            <i class="iconfont nav_right">&#xe697;</i></a>
                        <ul class="sub-menu">
                            <li>
                                <a onclick="xadmin.add_tab('商品规格列表','https://fly.layui.com/extend/croppers/')">
                                    <i class="iconfont">&#xe6a7;</i>
                                    <cite>商品规格列表</cite></a>
                            </li>
                        </ul>
                    </li>
                     -->
                </ul>
            </div>
        </div>
        <!-- 左侧菜单结束 -->
        <!-- 右侧主体开始 -->
        <div class="page-content">
            <div class="layui-tab tab" lay-filter="xbs_tab" lay-allowclose="false">
                <ul class="layui-tab-title">
                    <li class="home">
                        <i class="layui-icon">&#xe68e;</i>我的首页</li></ul>
                <div class="layui-unselect layui-form-select layui-form-selected" id="tab_right">
                    <dl>
                        <dd data-type="this">关闭当前</dd>
                        <dd data-type="other">关闭其它</dd>
                        <dd data-type="all">关闭全部</dd></dl>
                </div>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">
                        <iframe src='<%=basePath %>backPage/welcome.jsp' frameborder="0" scrolling="yes" class="x-iframe"></iframe>
                    </div>
                </div>
                <div id="tab_show"></div>
            </div>
        </div>
        <div class="page-content-bg"></div>
        <span></span>
        <style id="theme_style"></style>
        <!-- 右侧主体结束 -->
        <!-- 中部结束 -->
        
        
        
      <!-- 消息展示页面 -->
	   <form id="M_form" onsubmit="return false" style="display:none">
			<br>
			<h1 id="contextH"></h2>
	      <button onclick="xadmin.add_tab('留言列表','<%=basePath %>backPage/message-list.jsp')" style="margin-left: 730px;" id="goMessagePageBtn" class="layui-btn layui-btn-normal">去处理</button>
	   </form>
</body>
    
    <script type="text/javascript">
    //去后台首页
    		function toIndex(){
    			window.location.href="<%=basePath %>backPage/index.jsp";
    		}
    
    		//处理没有回复的消息
    		$(function(){
    			//展示未回复的信息
    			$("#viewMessage").click(function () {
    				layer.open({
    	  	        	  type: 1,
    	  	        	  title:"未回复消息页面",
    	  	        	  area: ['800px', '500px'],
    	  	        	  content: $('#M_form') 
    	  	        });
				})
				//当点击去处理跳到留言页面时刷新一下
				$("#goMessagePageBtn").click(function(){
					window.location.href="javascript:location.replace(location.href);";
				});
    			
    			$.get("<%=basePath %>back/queryAllMessageIsAnswer",{},function(res){
    				var count = 0;
    				if(res.length > 0){
    					count = res.length;
    					$("#noReplyMessageShow").css({
    						"width": "10px",
				            "height": "10px",
				            "background-color": "red",
				            "border-radius": "50%",
				            "display": "inline-block",
				            "margin-right": "-18px",
				            "margin-bottom": "3px"
    					});
    					var str = "";
    					for(var i = 0; i < res.length; i ++){
    						str += "用户名：<span>"+res[i].userName+"</span><p>留言内容：<span>"+res[i].content+"</span></p><hr>"
    					}
    					$("#contextH").append(str);
    					
    				}
    				
    				$("#addNoReplyCount").html(count+"条未回复");
    				
    			});
    		})
    		
    </script>

</html>